<!doctype html>
<html>
	<head>
		<meta charset="utf-8">
		<title>Product PreEdit</title>
        <%include("../inc/editCss.html"){};%>

	</head>
	<body class="no-skin">
		<div class="container-fluid">
			<div class="row">
			  <div class="breadcrumbs">
				<ul class="breadcrumb">
					<li><i class="ace-icon fa fa-home home-icon"></i><a href="../index.jspx" target="_top">首页</a></li>
					<li><a href="list.jspx">产品</a></li>
					<li class="active">修改</li>
				</ul>
				  <!-- /.breadcrumb -->
			  </div>
			  <!-- /.breadcrumbs -->
			</div>
			<!-- /.row -->
			<div class="row">
				<div class="page-content">
					<div class="page-header">
						<h1>产品修改</h1>
					</div>
					<div class="row">
						<div class="col-xd-12">
						    <form action="edit.jspx" method="post" class="form-horizontal" role="form" id="form-data">
						    	<div class="form-group">
									<label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 名称  </label>
									<div class="col-sm-10">
										<input type="hidden" name="id" value="${product.id!0}">
										<input type="text" id="name" name="name" placeholder="名称" class="col-sm-8" value="${product.name!}"/>
									</div>
								</div>
								<div class="space-4"></div>
								
								<div class="form-group">
									<label class="col-sm-2 control-label no-padding-right"> 所在分类</label>
									<div class="col-sm-4">
										<select name="main_category" id="main_category"></select>
										<select name="category" id="category"></select>
									</div>
									<label class="col-sm-2 control-label no-padding-right"> 品牌</label>
									<div class="col-sm-4">
										<select name="brand" id="brandId"></select>
									</div>
								</div>
								
								<div class="form-group">
									<label class="col-sm-2 control-label no-padding-right"> 型号 </label>
									<div class="col-sm-6">
										<input type="text" name="model" value="${product.model!}" class="form-control">
									</div>
								</div>
								
								<div class="form-group">
								    <label class="col-sm-2 control-label no-padding-right"> 默认图片</label>
									<div class="col-sm-8">
										<input id="photo" name="photo" type="text" value="${product.photo!}" class="form-control" placeholder="默认图片地址">
                                        <div id="upload2"></div>
									</div>
								</div>
								
								<div class="form-group">
									<label class="col-sm-2 control-label no-padding-right"> 简介 </label>
									<div class="col-sm-9">
										<textarea id="description_container" name="description">${product.description!}</textarea>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label no-padding-right">添加时间</label>
									<div class="col-sm-3">
										<input type="text" name="addtime" value="${product.addtime!date(),"yyyy-MM-dd HH:mm:ss"}">
									</div>
									
									<label class="col-sm-2 control-label no-padding-right">修改时间</label>
									<div class="col-sm-3">
										<input type="text" name="edittime" value="${date(),"yyyy-MM-dd HH:mm:ss"}">
									</div>
								</div>
								<div style="display:none">
									<input type="hidden" id="hits" name="hits" value="${product.hits!1}">
								</div>
								<div class="clearfix form-actions">
									<div class="col-sm-offset-2 col-sm-4">
										<button type="reset" class="btn">
											<i class="ace-icon fa fa-undo bigger-110"></i>
											重置
										</button>
										&nbsp;&nbsp;
										<button type="submit" class="btn btn-info">
											<i class="ace-icon fa fa-check bigger-110"></i>
											提交
										</button>
									</div>
								</div>
						    </form>
					    </div>
					</div>
					<!-- /.row -->
				</div>
				<!-- /.page-content -->
			</div>
		</div>
		<%include("../inc/editJs.html"){};%>

		<script>
			$(document).ready(function(){
				root.manage.product.edit.init({ctx:'${request.contextPath}',currentMainCategoryId:${product.category.parent.id!'-1'},currentCategoryId:${product.category.id!'-1'},currentBrandId:${product.brand.id!0}});
			});
		</script>
	</body>
</html>